package com.viptail.xiaogouzaijia.app;


import android.app.Activity;
import android.app.Application;
import android.content.SharedPreferences;

import com.viptail.xiaogouzaijia.api.RetrofitManager;

/**
 * Created by WangZhiChao on 2016/10/31.
 */

public class MyApp extends Application {


    private static MyApp app = null;

    private SharedPreferences UserPreferences;

    private boolean BasketEditting = false;

    public MyApp() {
        app = this;
    }

    public static MyApp getInstance() {
        return app;
    }


    @Override
    public void onCreate() {
        super.onCreate();
        RetrofitManager.getInstance().initRetrofit();

    }


    public SharedPreferences getUserPreferences() {
        if (UserPreferences == null) {
            UserPreferences = getSharedPreferences("userData", Activity.MODE_PRIVATE);
        }
        return UserPreferences;
    }




}